#!/bin/bash
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/Cent* /etc/yum.repos.d/bak

mount /dev/cdrom /mnt
cat > /etc/yum.repos.d/local.repo << EOF
[centos]
name=centos
baseurl=file:///mnt/
gpgcheck=0
enabled=1
EOF

yum clean all
yum repolist all
sleep 2

systemctl stop firewalld
setenforce 0
yum install -y net-tools


yum install -y dhcp
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf



echo 'subnet 192.168.23.0 netmask 255.255.255.0 {
 range 192.168.23.13 192.168.23.60;
 option domain-name-servers 192.168.23.10;
 option domain-name "wyl.com";
 option routers 192.168.23.254;
 option broadcast-address 192.168.23.255;
 default-lease-time 21600;
 max-lease-time 43200;
 host client {
 hardware ethernet 00:0C:29:7A:61:E4;
 fixed-address 192.168.23.13;
}
}' >> /etc/dhcp/dhcpd.conf 

systemctl start dhcpd




